function fromRecords<T>(
  items: T[],
  key: keyof T,
  value: keyof T,
) {
  return Object.fromEntries(items.map(({ [key]: k, [value]: v }) => [k, v]));
}
